package com.ch.roomdemo

import androidx.lifecycle.LiveData
import androidx.lifecycle.ViewModel

class PensionViewModel : ViewModel() {

    private val pensionRepository = PensionRepository()

    fun insertPension(vararg pension: Pension) {
        pensionRepository.insertPension(*pension)
    }


    fun deletePension(vararg pension: Pension) {
        pensionRepository.deletePension(*pension)
    }

    fun updatePension(vararg pension: Pension) {
        pensionRepository.updatePension(*pension)
    }

    fun getAllPension(): LiveData<List<Pension>> {
        return pensionRepository.getAllPension()
    }

    fun getPensionById(perSionId: Int): Pension {
        return pensionRepository.getPensionById(perSionId)
    }

    fun deleteAllPension() {
        pensionRepository.deleteAllPension()
    }
}